/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package pe.com.util;

import com.gargoylesoftware.htmlunit.SilentCssErrorHandler;
import org.openqa.selenium.Capabilities;
import org.openqa.selenium.htmlunit.HtmlUnitDriver;

/**
 *
 * @author romulogalindo
 */
public class HtmlUnitDriver2 extends HtmlUnitDriver{

    public HtmlUnitDriver2(Capabilities capabilities) {
        super(capabilities);
        
        this.getWebClient().setCssErrorHandler(new SilentCssErrorHandler());
        this.getWebClient().getOptions().setPopupBlockerEnabled(false);
        this.getWebClient().getOptions().setThrowExceptionOnScriptError(false);
        this.getWebClient().getOptions().setThrowExceptionOnFailingStatusCode(false);
        this.getWebClient().getOptions().setCssEnabled(false);
        this.getWebClient().getOptions().setTimeout(60000);
        this.getWebClient().setJavaScriptTimeout(30000); 
        this.getWebClient().getOptions().setUseInsecureSSL(true);
        this.getWebClient().getOptions().setAppletEnabled(false);
        this.getWebClient().getOptions().setActiveXNative(false);
        this.getWebClient().getOptions().setGeolocationEnabled(false);
        
    }
    
}
